/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

<!-- Load the flexslider -->

//  $(window).load(function() {
//    $('.flexslider').flexslider({
//          animation: "fade",  // slide or fade
//          controlsContainer: ".flex-container" // the container that holds the flexslider
//          
//    })
//  });

// $(window).load(function() {
//  // The slider being synced must be initialized first
//  $('#carousel').flexslider({
//    animation: "slide",
//    controlNav: false,
//    animationLoop: false,
//    slideshow: false,
//    itemWidth: 210,
//    itemMargin: 5,
//    asNavFor: '#slider'
//  });
// });



//jQuery.fn.center = function () {
//      this.css("position","absolute");
//    this.css("top", Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px");
//    this.css("left", Math.max(0, (($(window).width() - $(this).outerWidth()) / 2) + $(window).scrollLeft()) + "px");
//    
//    return this;
//}
//$("div.container:nth-child(1)").center(true);
// $("div.content:nth-child(2)").center(false);

(function($){
    $.fn.extend({
        center: function () {
            return this.each(function() {
                var top = ($(window).height() - $(this).outerHeight()) / 2;
                var left = ($(window).width() - $(this).outerWidth()) / 2;
                $(this).css({position:'absolute', margin:0, top: (top > 0 ? top : 0)+'px', left: (left > 0 ? left : 0)+'px'});
            });
        }
    }); 
})(jQuery);
 
 $('.container').center();
 